public class point {

    public final Long id;
    public final double lon;
    public final double lat;
    public String name = null;
    public point(Long id, double lon, double lat) {
        this.id = id;
        this.lon = lon;
        this.lat = lat;
    }

    public point(double lon, double lat) {
        this.id = null;
        this.lon = lon;
        this.lat = lat;
    }
    public double getX() {
        return lon;
    }

    public double getY() {
        return lat;
    }

    public double distanceTo(point p) {
        return GraphDB.distance(this.lon, this.lat, p.lon, p.lat);
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj.getClass() != this.getClass()) return false;
        point p = (point) obj;
        return this.getX() == p.getX() && this.getY() == p.getY();
    }

}
